﻿using System;

namespace Unis.Framework.RuleBase.Attributes
{
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = false)]
    public class ObjectRelationAttribute : Attribute
    {
        // Fields
        private string[] _RelationSetting;
        private int _SaveOrderLevel;

        // Methods
        public ObjectRelationAttribute(int saveOrderLevel)
        {
            this._SaveOrderLevel = saveOrderLevel;
        }

        public ObjectRelationAttribute(int saveOrderLevel, params string[] relation)
        {
            this._SaveOrderLevel = saveOrderLevel;
            this._RelationSetting = relation;
        }

        // Properties
        public string[] RelationSetting
        {
            get
            {
                return this._RelationSetting;
            }
            set
            {
                this._RelationSetting = value;
            }
        }

        public int SaveOrderLevel
        {
            get
            {
                return this._SaveOrderLevel;
            }
            set
            {
                this._SaveOrderLevel = value;
            }
        }
    }
}
